package pojo;

import java.time.LocalDateTime;

public class User {
    // 用户ID (主键)
    private int userId;

    // 用户名
    private String username;

    // 密码
    private String password;

    // 用户邮箱
    private String email;

    // 用户全名
    private String fullName;

    // 用户头像
    private String profilePicture;

    // 创建时间
    private LocalDateTime createTime;

    // 最后登录时间
    private LocalDateTime lastLogin;

    // 账户权限 ('1' 表示普通用户，'0' 表示管理员用户)
    private String status;

    // 构造函数
    public User(){}     // 必须要有无参构造
    public User(int userId, String username, String password, String email, String fullName,
                String profilePicture, LocalDateTime createTime, LocalDateTime lastLogin, String status) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.email = email;
        this.fullName = fullName;
        this.profilePicture = profilePicture;
        this.createTime = createTime;
        this.lastLogin = lastLogin;
        this.status = status;
    }

    public User(String username, String password, String email, String fullName, String profilePicture, String status) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.fullName = fullName;
        this.profilePicture = profilePicture;
        this.status = status;
    }

    public User(int userId, String username, String password, String email, String fullName) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.email = email;
        this.fullName = fullName;
    }
    public User(int userId, String username, String password, String email, String fullName, String status) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.email = email;
        this.fullName = fullName;
        this.status = status;
    }
// Getter 和 Setter 方法

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getProfilePicture() {
        return profilePicture;
    }

    public void setProfilePicture(String profilePicture) {
        this.profilePicture = profilePicture;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getLastLogin() {
        return lastLogin;
    }

    public void setLastLogin(LocalDateTime lastLogin) {
        this.lastLogin = lastLogin;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    // Override toString() 方法，方便打印对象
    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", fullName='" + fullName + '\'' +
                ", profilePicture='" + profilePicture + '\'' +
                ", createTime=" + createTime +
                ", lastLogin=" + lastLogin +
                ", status=" + status +
                '}';
    }
}
